package com.example.prison.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.prison.entity.CarAlarmRecord;
import com.example.prison.service.CarAlarmRecordService;
import com.example.prison.mapper.CarAlarmRecordMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* @author jiang
* @description 针对表【car_alarm_record】的数据库操作Service实现
* @createDate 2024-06-03 14:17:45
*/
@Service
public class CarAlarmRecordServiceImpl extends ServiceImpl<CarAlarmRecordMapper, CarAlarmRecord>
    implements CarAlarmRecordService{

    @Autowired
    private CarAlarmRecordMapper carAlarmRecordMapper;

    @Override
    public PageInfo<CarAlarmRecord> get(int pageNumber, int pageSize, String carNumber, String beginTime, String endTime) {
        PageHelper.startPage(pageNumber, pageSize);
        return new PageInfo<>(carAlarmRecordMapper.get(carNumber, beginTime, endTime));
    }

    @Override
    public int add(CarAlarmRecord record) {
        record.setSolve("未处理");
        record.setType("滞留");
        carAlarmRecordMapper.add(record);
        return 1;
    }

    @Override
    public void delete(Integer[] ids) {
        carAlarmRecordMapper.deleting(ids);
    }

    @Override
    public void handle(Integer id, String handle, String handleMessage) {
        carAlarmRecordMapper.handle(id, handle, handleMessage);
    }

    @Override
    public CarAlarmRecord getById(Integer id) {
        return carAlarmRecordMapper.getById(id);
    }


}




